package com.ml.mall.entity.sys;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "用户表")

public class SysUser implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value="主键id",example = "1")
    private Long id;

    /**
     * 账号为邮箱；
     */
    @TableField(value = "acc")
    @ApiModelProperty(value="账号为邮箱；")
    private String acc;

    /**
     * 密码
     */
    @TableField(value = "pwd")
    @ApiModelProperty(value="密码")
    @JsonIgnore
    private String pwd;

    /**
     * 经销商ID
     */
    @TableField(value = "company_id")
    @ApiModelProperty(value="经销商ID",example = "1")
    private Long companyId;

    /**
     * 角色ID
     */
    @TableField(value = "role_id")
    @ApiModelProperty(value="角色ID",example = "1")
    private Integer roleId;

    /**
     * 角色ID
     */
    @TableField(value = "role_type")
    @ApiModelProperty(value="角色类型：用于区分四种类型：1：管理员；2合作商 ；3：卖家；4买家",example = "1")
    private Integer roleType;

    /**
     * 账号头像
     */
    @TableField(value = "head_url")
    @ApiModelProperty(value="账号头像")
    private String headUrl;

    /**
     * 名称
     */
    @TableField(value = "name")
    @ApiModelProperty(value="名称")
    private String name;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    @ApiModelProperty(value="邮箱")
    private String email;

    /**
     * 盐
     */
    @TableField(value = "salt")
    @ApiModelProperty(value="盐")
    private String salt;

    /**
     * 状态：0正常 1禁用
     */
    @TableField(value = "state")
    @ApiModelProperty(value="状态：0正常 1禁用",example = "1")
    //@TableLogic(value = "0",delval = "1")
    private Integer state;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "is_delete",fill = FieldFill.INSERT)
    private Integer isDelete;

    /**
     * 创建时间
     */
    @TableField(value = "create_at",fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建时间")
    private Date createAt;

    /**
     * 更新时间
     */
    @TableField(value = "update_at",fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value="更新时间")
    private Date updateAt;

    /**
     * 最新登陆时间
     */
    @TableField(value = "last_login_at")
    @ApiModelProperty(value="最新登陆时间")
    private Date lastLoginAt;

    @TableField(value = "tel_number")
    @ApiModelProperty(value="电话")
    private String telNumber;

    @TableField(value = "last_name")
    @ApiModelProperty(value="名称2")
    private String lastName;

    @TableField(exist = false)
    private String companyName;
}